﻿using System;
using System.Collections;

namespace DotNet.Utilities
{
    /// <summary>
    /// BaseConfigInfo 集合类
    /// </summary>
    [Serializable]
    public class BaseConfigInfoCollection : CollectionBase
    {
      
        public BaseConfigInfoCollection()
        {
        }

      
        public BaseConfigInfoCollection(BaseConfigInfoCollection value)
        {
            this.AddRange(value);
        }

     
        public BaseConfigInfoCollection(BaseConfigInfo[] value)
        {
            this.AddRange(value);
        }

       
        public BaseConfigInfo this[int index]
        {
            get { return ((BaseConfigInfo)(this.List[index])); }
        }

        public int Add(BaseConfigInfo value)
        {
            return this.List.Add(value);
        }

        public void AddRange(BaseConfigInfo[] value)
        {
            for (int i = 0; (i < value.Length); i = (i + 1))
            {
                this.Add(value[i]);
            }
        }

      
        public void AddRange(BaseConfigInfoCollection value)
        {
            for (int i = 0; (i < value.Count); i = (i + 1))
            {
                this.Add((BaseConfigInfo)value.List[i]);
            }
        }

    
        public bool Contains(BaseConfigInfo value)
        {
            return this.List.Contains(value);
        }

      
        public void CopyTo(BaseConfigInfo[] array, int index)
        {
            this.List.CopyTo(array, index);
        }

     
        public int IndexOf(BaseConfigInfo value)
        {
            return this.List.IndexOf(value);
        }

        public void Insert(int index, BaseConfigInfo value)
        {
            List.Insert(index, value);
        }

        public void Remove(BaseConfigInfo value)
        {
            List.Remove(value);
        }

     
        public new BaseConfigInfoCollectionEnumerator GetEnumerator()
        {
            return new BaseConfigInfoCollectionEnumerator(this);
        }

        public class BaseConfigInfoCollectionEnumerator : IEnumerator
        {
            private IEnumerator _enumerator;
            private IEnumerable _temp;

          
            public BaseConfigInfoCollectionEnumerator(BaseConfigInfoCollection mappings)
            {
                _temp = ((IEnumerable)(mappings));
                _enumerator = _temp.GetEnumerator();
            }

         
            public BaseConfigInfo Current
            {
                get { return ((BaseConfigInfo)(_enumerator.Current)); }
            }

            object IEnumerator.Current
            {
                get { return _enumerator.Current; }
            }

          
            public bool MoveNext()
            {
                return _enumerator.MoveNext();
            }

            bool IEnumerator.MoveNext()
            {
                return _enumerator.MoveNext();
            }

         
            public void Reset()
            {
                _enumerator.Reset();
            }

            void IEnumerator.Reset()
            {
                _enumerator.Reset();
            }
        }
    }
}
